home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
libs
/
reqtoolsdev.lha
/
ReqTools
/
Glue
/
GCC
/
gcc_glue.lha
/
lib
/
c.s
next >
Wrap
Text File
|
1994-04-19
|
2KB
|
99 lines
| stripped not baserelative startup code for gcc v2.3.3
| (c) by Gunther Nikl Die Jan 11 17:44 1994
| No really bugs known
| some specific defines
_LVOForbid = -132
_LVOGetMsg = -372
_LVOReplyMsg = -378
_LVOWaitPort = -384
_LVOCloseLibrary = -414
_LVOOpenLibrary = -552
_LVOCurrentDir = -126
| public symbols
.globl __exit
.text
| first entry - init some vars, check for cli or wb start
start: moveml d2-d7/a2-a6,sp@-
movel sp,_SaveSP
movel 4:W,a6
movel a6,_SysBase
movel a6@(276),a3
tstl a3@(172)
bnes fromCLI
| wb start - get wbmsg, open dos, change dir
fromWB: lea a3@(92),a0
jsr a6@(_LVOWaitPort)
lea a3@(92),a0
jsr a6@(_LVOGetMsg)
movel d0,_WbMsg
| cli start - open dos
fromCLI: jbsrs OpenDOS
beqs cleanup
movel _WbMsg,d1
beqs isCLI
movel d1,a1
movel a1@(36),a1
movel a1@,d1
jsr a6@(_LVOCurrentDir)
isCLI: jbsr __main
jras cleanup
| exit() entry - get return val, restore stackptr
__exit: movel sp@(4:W),d0
movel _SaveSP,sp
| cleanup - close dos, reply wbmsg
cleanup: movel d0,d7
movel _SysBase,a6
movel _DOSBase,d0
beqs nodos
movel d0,a1
jsr a6@(_LVOCloseLibrary)
nodos: movel _WbMsg,d2
beqs todos
jsr a6@(_LVOForbid)
movel d2,a1
jsr a6@(_LVOReplyMsg)
todos: movel d7,d0
moveml sp@+,d2-d7/a2-a6
rts
| open dos v33+
OpenDOS: lea pc@(DosName+2),a1
movql #33,d0
jsr a6@(_LVOOpenLibrary)
movel d0,a6
movel a6,_DOSBase
rts
DosName: .asciz "dos.library"
.even
| data area
.data
.comm _SysBase,4
.comm _DOSBase,4
.comm _SaveSP,4
.comm _WbMsg,4